#include "vector_float.h"



vector_float::vector_float()
{
	create_vector(0);
	vptr=nullptr;
	this->size=0;
}


void vector_float::create_vector( int s)
{
	vptr=new float[s];
	size = s;
}

void vector_float::delete_vector()
{
	delete [] vptr;
	size=0;
}

vector_float::~vector_float()
{
	delete_vector();

}

vector_float::vector_float(int s)
{
	create_vector(s);
}

void vector_float::set(float value, int index)
{
	*vptr=value;
	size=index;
}

void vector_float::read_from_keyboard()
{
	cin >> size;
	for (int i = 0; i < size; i++)
	{
		cin >> vptr[i];
	}
}

void vector_float::print()
{
	cout << "[";
	for (int i = 0; i < size; i++)
	{
		cout << vptr[i] << ",";
	}
	cout << "]" << endl;
} 